package com.aaa.controller;

import com.aaa.entity.UserInfo;
import com.aaa.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("user")
public class UserController {
    @Autowired
    UserService us;

    @RequestMapping("userAdd")
    public int userAdd(UserInfo userInfo){
        return us.userAdd(userInfo);
    }

    /**
     * 检查用户是否重复
     * @param username
     * @return 重复的数量 select count(*) ...
     */
    @RequestMapping("checkUserRepeat")
    public int checkUserRepeat(String username){

        return us.checkUserRepeat(username);
    }
}
